package itsm.isperp.framework.web.formatter;

import itsm.isperp.framework.utils.DateUtils;

import java.util.Date;
import java.util.Locale;

import org.springframework.format.datetime.DateFormatter;

/**
 * 
 * 
 * 
 * @author lizx
 * @date 2013-8-28
 * 
 */
public class CustomerDateFormatter extends DateFormatter {
	@Override
	public String print(Date date, Locale locale) {
		if (date instanceof java.sql.Timestamp) {
			return DateUtils.formatDateTime(date);
		} else if (date instanceof java.sql.Time) {
			return DateUtils.formatDate(date);
		}

		return getDateFormat(locale).format(date);
	}
}